﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WebCamWorker.ViewModel;
using System.IO;

namespace WebCamWorker
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            //DispatcherTimer
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);

            //CommandBinding customCommandBinding = new CommandBinding(
            //    CustomRoutedCommand, ExecutedCustomCommand, CanExecuteCustomCommand);
        }

        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            ((VMWebCamShow)FindResource("VMWebCamShow")).Start();
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            ((VMWebCamShow)FindResource("VMWebCamShow")).Close();
        }

        private void Image_MouseDown(object sender, MouseButtonEventArgs e)
        {
            //var point = e.GetPosition(WebCamImage);
            //File.AppendAllText("data.txt", string.Format("{0} - {1}\n", point.X, point.Y));
        }

        private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
        {

        }
    }
}
